<template>
  <div id="OrdersTitle">
    <v-details
      :inputConfig="inputConfig"
      :detailData="inputData"
      :rules="rules"
      ref="input"
    ></v-details>
  </div>
</template>

<script>
import details from 'commons/Detail'
import baseMixin from "@/mixins/BaseMixin";

export default {
  props: {
    inputData: {
      type: Object,
    }
  },
  mixins: [baseMixin],
  name: "OrdersTitle",
  data () {
    return {
      rules: {
        rptId: [
          { required: true, trigger: 'blur' },
        ],
      },
      flag: false
    }
  },
  computed: {
    inputConfig () {
      return [
        [
          {
            type: "input",
            label: this.$t('manage.rptId'),
            props: "rptId",
            disabled: this.flag
          },
          {
            type: "input",
            label: this.$t('manage.rptTitle'),
            props: "rptTitle",
            disabled: this.flag
          },
          {
            type: "select",
            label: this.$t('manage.defaultprinter'),
            props: "defaultprinter",
            options: this.getOptions("queryDefaultPrinterDropDown")
          },
        ],
        [
          {
            type: "select",
            label: this.$t('manage.printoption'),
            props: "printoption",
            options: this.getOptions("codelkup/REPPRNOPT")
          },
          {
            type: "select",
            label: this.$t('config.locCategory'),
            props: "categoryId",
            options: this.getOptions("queryCategoryIdDropDown")
          },
          {
            type: "select",
            label: this.$t('manage.customreporttype'),
            props: "customreporttype",
            options: this.getOptions("codelkup/REPORTTYPE")
          },
        ],
        [
          {
            type: "select",
            label: this.$t('manage.canaccess'),
            props: "canaccess",
            options: this.getOptions("codelkup/RPTACCESS")
          },
          {
            type: "checkbox",
            label: this.$t('manage.baseReport'),
            props: "baseReport",
            disabled: this.flag
          },
          {
            type: "textarea",
            label: this.$t('manage.birtrptUrl'),
            props: "birtrptUrl",
              height:"100px"
          },
        ],
        [
          /*{
            type: "textarea",
            label: "Infor 报告 URL",
            props: "rptUrl",
          },*/
          {
            type: "textarea",
            label: this.$t('manage.rtx_bomkey'),
            props: "comments",
          }
        ],
      ]
    },
  },
  methods: {},
  mounted () {
    if (Object.keys(this.$store.state.skip).length !== 0) {
      let data = this.$store.state.skip;
      if (data.newFlag) {
        this.flag = false;
      } else {
        this.flag = true
      }
    } else if (this.$store.state.newFlag) {
      this.flag = false;
    } else {
      this.flag = true
    }
  },
  watch: {},
  components: {
    'v-details': details
  }
}
</script>

<style scoped>
</style>
